<?php

class Public_Profile_ViewSuccessView extends BlogPublicBaseView
{
	public function executeHtml(AgaviRequestDataHolder $rd)
	{
		$this->setupHtml($rd, 'blog');
		$ro = $this->getContext()->getRouting();
		
		/* @var $user BlogUser */
		$user = $this->getContext()->getUser();
		if (is_null($user->getAttribute('user_id'))) {
		    $this->setAttribute('login_name', 'Guest');
		    $this->setAttribute('display_name', 'Guest');
		} else {
    		$this->setAttribute('login_name', $user->getAttribute('username'));
    		$this->setAttribute('display_name', $user->getAttribute('display_name'));
    		$this->setAttribute('edit_route', $ro->gen('own_profile.edit'));
    		$this->setAttribute('email', $user->getAttribute('email'));
    		$this->setAttribute('website', $user->getAttribute('website'));
		}
		
		if (!is_null($rd->getParameter('welcome'))) {
		    $this->setAttribute('welcome', 1);
		}
		
		$this->setAttribute('title', 'View my profile');
	}
}

?>